package xyz.xtt.admin.constants;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author Jim kwok
 * @since 2025/2/25
 */

public enum AssetHandleEnum {

    DROP_ASSET(0, "drop"),
    BURN_ASSET(1, "burn"),
    MINT_ASSET(2, "mint"),
    TRANSFER_ASSET(3, "transfer"),
    REUSE_ASSET(4, "reuse");


    private final Integer code;
    private final String method;


    AssetHandleEnum(Integer code, String method) {
        this.code = code;
        this.method = method;
    }


    public Integer code() {
        return code;
    }

    public String method() {
        return method;
    }

    public static boolean checkMethod(String method) {
        return Arrays.stream(AssetHandleEnum.values()).anyMatch(x -> Objects.equals(x.method, method));
    }

    ;
}
